import http from "@/utils/request";

const apiPrefix = "/company";


export async function addCompany(data) {
    return await http.request({
        data: data,
        url: apiPrefix,
        method: 'post'
    })
}

export async function deleteCompanyById(id){
    return await http.request({
        params: {
            id
        },
        url: apiPrefix+'/id',
        method: 'delete'
    })
}

export async function deleteCompanyByIds(ids){
    return await http.request({
        params: {
            ids
        },
        url: apiPrefix+'/batch',
        method: 'delete'
    })
}


export async function searchCompanyById(id){
    return await http.request({
        params: {
            id
        },
        url: apiPrefix+'/id',
        method: 'get'
    })
}

export async function searchCompany(){
    return await http.request({
        url: apiPrefix+'/last ',
        method: 'get'
    })
}

export async function searchCompanyByPage(params){
    return await http.request({
        params: params,
        url: apiPrefix+'/page',
        method: 'get'
    })
}


export async function updateCompanyById(data){
    return await http.request({
        data: data,
        url: apiPrefix,
        method: 'put'
    })
}
